//
//  DetailRootMvvmModel.m
//  ABSallRec
//
//  Created by 我演示 on 2019/11/10.
//  Copyright © 2019 Jerry-Fu. All rights reserved.
//

#import "DetailRootMvvmModel.h"
#import "DetailRootBannerModel.h"
#import "DetailRootModel.h"


/** banner height 固定*/
#define kBannerHeight 375

/** 商品详细介绍的height信息*/
#define kDetailShowHeight 150

/** 显示促销*/
#define kDetailPromotion 44




@implementation DetailRootMvvmModel

-(void)setRootModel:(DetailRootModel *)rootModel {
    _rootModel = rootModel ;
 
    /// 滚动图高度
    self.bannerHeight = kBannerHeight ;
    
    // 商品来源的描述
    self.showDetailHeight = kDetailShowHeight;
    
    //是不是展示促销图标
    self.detailPromotionHeight = rootModel.promotion ==  0 ? 0 : kDetailPromotion ;
    
    // 4: 选择规格展示
    self.showSocketImageHeight = 120 ;
    
    /// 5 .用户评价的高度
    self.userAppraiseHeight = 210 ;
    
    //6: 商品来源的高度
    self.goodsSourceHeight = 170 ;
    
    
    //7： 单个 图片的高度
    self.detailImageHeight = 480 ;
    
    CGFloat allImageHeight = self.detailImageHeight * rootModel.detailsImgs.count ;
    
    
    
    /**总高度计算*/
//    @property(nonatomic,assign) CGFloat headrViewHeight ;
    self.headerViewHeight = self.bannerHeight + self.showDetailHeight + self.detailPromotionHeight
    + self.selectCustomHeight +self.showSocketImageHeight + self.userAppraiseHeight + self.goodsSourceHeight + allImageHeight ;
    
}

@end
